

grammar non_ho_niente_da_mettermi;

scope: closet alias* event* outfit_ideas EOF;

closet:                 LOADCLOSET COLON PATH SEMICOLON
      ;

alias :            STRING EQUAL list SEMICOLON
           ;

statement :             expression 
                        |filter 
          ;

expression : 
			STRING IS (NOT)? STRING SEMICOLON  
		
			|STRING (NOT)? IN (list|STRING) SEMICOLON 
           ;

list :          	LS_B STRING (COMMA STRING)* RS_B
     ;


filter   :              (EXCLUDE|INCLUDE ONLY) list SEMICOLON   
         ;

category_Rule : 	CATEGORY STRING LC_B statement* RC_B
              ;
		
block   :		LC_B filter* category_Rule* RC_B  
        ;

event :                 WHEN STRING SEMICOLON WHERE STRING SEMICOLON SUGGEST block
      ;

outfit_ideas:           OUTFIT IDEAS FOR STRING STRING
            ;

EQUAL: '=';
LOADCLOSET : 'loadCloset';
SEMICOLON : ';';
COLON: ':';
IS: 'is';
NOT: 'not';
IN: 'in';
LS_B:'[';
RS_B:']';
COMMA:',';
EXCLUDE: 'exclude';
INCLUDE: 'include';
ONLY:	'only';
CATEGORY: 'category';
IF: 'if';
THEN: 'then';
ELSE: 'else';
LC_B: '{';
RC_B: '}';
OUTFIT: 'outfit';
IDEAS:	'ideas';
FOR:    'for';
WHEN: 'when';
WHERE: 'where';
SUGGEST: 'suggest';

STRING
    :  LETTER (LETTER|DIGIT|'_'|'-')*  
    ;
    
PATH	: '"' (('/'|'.'|'..') STRING)+ '"'
		;
		 

fragment LETTER : [a-zA-Z] ;
fragment DIGIT : [0-9];

/*fragment
ESC_SEQ
    :   '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
    ;
*/

WS : [ \t\r\n]+ -> skip;